public class Card {
	private int suit; // R = 0, W = 1, Y = 2, O = 3
	private int rank; // value v1 = 0, v2 = 1, v3 = 2, v4 = 3, v5 = 4, v6 = 5
	// 12
	private String front; // filename of image to display front of card
	private String back; // filename of image to display back of card
	private static String deck;

	public static int pos = 53;
	public static int detail = 53;

	public static int cardPos1 = 0;
	public static int cardPos2 = 0;
	public static int cardPos3 = 0;
	public static int cardPos4 = 0;
	public static int cardPos5 = 0;
	public static int cardPos6 = 0;
	public static int cardPos7 = 0;
	public static int cardPos8 = 0;
	public static int cardPos9 = 0;

	public static int cardPos1b = 0;
	public static int cardPos2b = 0;
	public static int cardPos3b = 0;
	public static int cardPos4b = 0;
	public static int cardPos5b = 0;
	public static int cardPos6b = 0;
	public static int cardPos7b = 0;
	public static int cardPos8b = 0;
	public static int cardPos9b = 0;

	public static int C1x = 790;
	public static int C2x = 690;
	public static int C3x = 590;
	public static int C4x = 490;
	public static int C5x = 390;
	public static int C6x = 290;
	public static int CDy = 565;
	public static int CPy = 35;

	public static int S1x = 80;
	public static int S2x = 170;
	public static int S3x = 260;
	public static int S4x = 350;
	public static int S5x = 440;
	public static int S6x = 530;
	public static int S7x = 620;
	public static int S8x = 710;
	public static int S9x = 800;
	public static int Say = 415;
	public static int Sby = 400;
	public static int Scy = 385;
	public static int Sdy = 220;
	public static int Sey = 205;
	public static int Sfy = 190;

	// create a new card based on integer 0 = 1R, 1 = 2R, ..., 53 = 9B
	public Card(int card) {
		rank = card % 9;
		suit = card / 9;
	}

	// use this constructor if you want to plot the cards
	public Card(int card, String front, String back) {
		this(card);
		this.front = front;
		this.back = back;
	}

	public void drawFront(double x, double y) {
		StdDraw.picture(x, y, front);
	}

	public void drawBack(double x, double y) {
		StdDraw.picture(x, y, back);
	}

	public static void drawStone(double x, double y) {
		StdDraw.picture(x, y, "stone.gif");
	}

	public static void drawRules(double x, double y) {
		StdDraw.picture(x, y, "rules.gif");
	}

	public int rank() {
		return rank;
	}

	public int suit() {
		return suit;
	}

	// represent cards like "2H", "9C", "JS", "AD"
	public String toString() {
		// String ranks = "123456789";
		// String suits = "RWYOPB";
		// return "Card " + suits.charAt(suit) + "" + ranks.charAt(rank);
		int c1 = 0;
		int c2 = 0;
		if (suit == 0) {
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		} else if (suit == 1) {
			c1 = 9;
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		} else if (suit == 2) {
			c1 = 18;
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		} else if (suit == 3) {
			c1 = 27;
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		} else if (suit == 4) {
			c1 = 36;
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		} else if (suit == 5) {
			c1 = 45;
			c2 = c1 + rank;
			String result = Integer.toString(c2);
			return result;
		}
		return "An error has occurred";
	}

	public static void placeStones() {
		// draw stones
		drawStone(800, 300);
		drawStone(710, 300);
		drawStone(620, 300);
		drawStone(530, 300);
		drawStone(440, 300);
		drawStone(350, 300);
		drawStone(260, 300);
		drawStone(170, 300);
		drawStone(80, 300);
	}

	public static void compareRank(int drank, int prank, int xo, int yo,
			int xd, int yd, int xp, int yp) {
		System.out.println("D " + drank + " P " + prank);
		if (drank > prank) {
			StdDraw.updateStone(xo, yo);
			drawStone(xd, yd);
			// } else if (prank > drank) {
			// StdDraw.updateStone(xo, yo);
			// drawStone(xp, yp);
			// }
		} else {
			StdDraw.updateStone(xo, yo);
			drawStone(xp, yp);
		}
		// } else {
		// System.out.println("stones are the same value and high sum total");
		// }
	}

	public static void dealDealer() {
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C1 = detail;
		Card c1 = new Card(detail, detail + ".gif", "back.gif");
		c1.drawBack(C1x, CDy);

		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C2 = detail;
		Card c2 = new Card(detail, detail + ".gif", "back.gif");
		c2.drawBack(C2x, CDy);

		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C3 = detail;
		Card c3 = new Card(detail, detail + ".gif", "back.gif");
		c3.drawBack(C3x, CDy);

		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C4 = detail;
		Card c4 = new Card(detail, detail + ".gif", "back.gif");
		c4.drawBack(C4x, CDy);

		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C5 = detail;
		Card c5 = new Card(detail, detail + ".gif", "back.gif");
		c5.drawBack(C5x, CDy);

		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C6 = detail;
		Card c6 = new Card(detail, detail + ".gif", "back.gif");
		c6.drawBack(C6x, CDy);
		pos--;
	}

	public static void hideDealer() {
		Card H1 = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
		H1.drawBack(C1x, CDy);
		Card H2 = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
		H2.drawBack(C2x, CDy);
		Card H3 = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
		H3.drawBack(C3x, CDy);
		Card H4 = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
		H4.drawBack(C4x, CDy);
		Card H5 = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
		H5.drawBack(C5x, CDy);
		Card H6 = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
		H6.drawBack(C6x, CDy);
	}

	public static void showDealer() {
		Card H1 = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
		H1.drawFront(C1x, CDy);
		Card H2 = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
		H2.drawFront(C2x, CDy);
		Card H3 = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
		H3.drawFront(C3x, CDy);
		Card H4 = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
		H4.drawFront(C4x, CDy);
		Card H5 = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
		H5.drawFront(C5x, CDy);
		Card H6 = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
		H6.drawFront(C6x, CDy);
	}

	public static void hidePlayer() {
		Card H1 = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
		H1.drawBack(C1x, CPy);
		Card H2 = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
		H2.drawBack(C2x, CPy);
		Card H3 = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
		H3.drawBack(C3x, CPy);
		Card H4 = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
		H4.drawBack(C4x, CPy);
		Card H5 = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
		H5.drawBack(C5x, CPy);
		Card H6 = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
		H6.drawBack(C6x, CPy);
	}

	public static void showPlayer() {
		Card H1 = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
		H1.drawFront(C1x, CPy);
		Card H2 = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
		H2.drawFront(C2x, CPy);
		Card H3 = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
		H3.drawFront(C3x, CPy);
		Card H4 = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
		H4.drawFront(C4x, CPy);
		Card H5 = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
		H5.drawFront(C5x, CPy);
		Card H6 = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
		H6.drawFront(C6x, CPy);
	}

	public static void dealPlayer() {
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C7 = detail;
		Card c7 = new Card(detail, detail + ".gif", "back.gif");
		c7.drawFront(C1x, CPy);
		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C8 = detail;
		Card c8 = new Card(detail, detail + ".gif", "back.gif");
		c8.drawFront(C2x, CPy);
		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C9 = detail;
		Card c9 = new Card(detail, detail + ".gif", "back.gif");
		c9.drawFront(C3x, CPy);
		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C10 = detail;
		Card c10 = new Card(detail, detail + ".gif", "back.gif");
		c10.drawFront(C4x, CPy);
		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C11 = detail;
		Card c11 = new Card(detail, detail + ".gif", "back.gif");
		c11.drawFront(C5x, CPy);
		pos--;
		detail = Integer.parseInt(Deck.cards[pos].toString());
		Board.C12 = detail;
		Card c12 = new Card(detail, detail + ".gif", "back.gif");
		c12.drawFront(C6x, CPy);
		pos--;
	}

	public static void showDeck() {
		if (pos >= -1) {
			StdDraw.updateDeck();
			StdDraw.setPenColor(StdDraw.WHITE);
			deck = Integer.toString(pos + 1);
			StdDraw.text(10, 580, deck);
		}
	}

	public static void dealC12() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C12 = detail;
			Card c12 = new Card(detail, detail + ".gif", "back.gif");
			c12.drawFront(C6x, CPy);
			pos--;
		} else {
			Board.C12hide = true;
		}
	}

	public static void dealC11() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C11 = detail;
			Card c11 = new Card(detail, detail + ".gif", "back.gif");
			c11.drawFront(C5x, CPy);
			pos--;
		} else {
			Board.C11hide = true;
		}
	}

	public static void dealC10() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C10 = detail;
			Card c10 = new Card(detail, detail + ".gif", "back.gif");
			c10.drawFront(C4x, CPy);
			pos--;
		} else {
			Board.C10hide = true;
		}
	}

	public static void dealC9() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C9 = detail;
			Card c9 = new Card(detail, detail + ".gif", "back.gif");
			c9.drawFront(C3x, CPy);
			pos--;
		} else {
			Board.C9hide = true;
		}
	}

	public static void dealC8() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C8 = detail;
			Card c8 = new Card(detail, detail + ".gif", "back.gif");
			c8.drawFront(C2x, CPy);
			pos--;
		} else {
			Board.C8hide = true;
		}
	}

	public static void dealC7() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C7 = detail;
			Card c7 = new Card(detail, detail + ".gif", "back.gif");
			c7.drawFront(C1x, CPy);
			pos--;
		} else {
			Board.C7hide = true;
		}
	}

	public static void dealC6() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C6 = detail;
			Card c6 = new Card(detail, detail + ".gif", "back.gif");
			c6.drawFront(C6x, CDy);
			pos--;
		} else {
			Board.C6hide = true;
		}
	}

	public static void dealC5() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C5 = detail;
			Card c5 = new Card(detail, detail + ".gif", "back.gif");
			c5.drawFront(C5x, CDy);
			pos--;
		} else {
			Board.C5hide = true;
		}
	}

	public static void dealC4() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C4 = detail;
			Card c4 = new Card(detail, detail + ".gif", "back.gif");
			c4.drawFront(C4x, CDy);
			pos--;
		} else {
			Board.C4hide = true;
		}
	}

	public static void dealC3() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C3 = detail;
			Card c3 = new Card(detail, detail + ".gif", "back.gif");
			c3.drawFront(C3x, CDy);
			pos--;
		} else {
			Board.C3hide = true;
		}
	}

	public static void dealC2() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C2 = detail;
			Card c2 = new Card(detail, detail + ".gif", "back.gif");
			c2.drawFront(C2x, CDy);
			pos--;
		} else {
			Board.C2hide = true;
		}
	}

	public static void dealC1() {
		if (pos >= 0) {
			detail = Integer.parseInt(Deck.cards[pos].toString());
			Board.C1 = detail;
			Card c1 = new Card(detail, detail + ".gif", "back.gif");
			c1.drawFront(C1x, CDy);
			pos--;
		} else {
			Board.C1hide = true;
		}
	}

	public static void playCard12() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C12;
				dealC12();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C12;
				dealC12();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C12;
				dealC12();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C12;
				dealC12();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C12;
				dealC12();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C12;
				dealC12();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C12;
				dealC12();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C12;
				dealC12();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C12;
				dealC12();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C12;
				dealC12();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C12;
				dealC12();
				cardPos4++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C12;
				dealC12();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C12;
				dealC12();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C12;
				dealC12();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C12;
				dealC12();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C12;
				dealC12();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C12;
				dealC12();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C12;
				dealC12();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C12;
				dealC12();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C12;
				dealC12();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C12;
				dealC12();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C12;
				dealC12();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C12;
				dealC12();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C12;
				dealC12();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C12;
				dealC12();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C12;
				dealC12();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C12;
				dealC12();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard11() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C11;
				dealC11();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C11;
				dealC11();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C11;
				dealC11();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C11;
				dealC12();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C11;
				dealC11();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C11;
				dealC11();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C11;
				dealC11();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C11;
				dealC11();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C11;
				dealC11();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C11;
				dealC11();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C11;
				dealC11();
				cardPos4++;
			} else if (cardPos4 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C11;
				dealC11();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C11;
				dealC11();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C11;
				dealC11();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C11;
				dealC11();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C11;
				dealC11();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C11;
				dealC11();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C11;
				dealC11();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C11;
				dealC11();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C11;
				dealC11();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C11;
				dealC11();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C11;
				dealC11();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C11;
				dealC11();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C11;
				dealC11();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C11, Board.C11 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C11;
				dealC11();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C11;
				dealC11();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C11;
				dealC11();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard10() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C10;
				dealC10();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C10;
				dealC10();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C10;
				dealC10();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C10;
				dealC10();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C10;
				dealC10();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C10;
				dealC10();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C10;
				dealC10();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C10;
				dealC10();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C10;
				dealC10();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C10;
				dealC10();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C10;
				dealC10();
				cardPos4++;
			} else if (cardPos4 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C10;
				dealC10();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C10;
				dealC10();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C10;
				dealC10();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C10;
				dealC10();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C10;
				dealC10();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C10;
				dealC10();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C10;
				dealC10();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C10;
				dealC10();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C10;
				dealC10();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C10;
				dealC10();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C10;
				dealC10();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C10;
				dealC10();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C10;
				dealC10();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C10, Board.C10 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C10;
				dealC10();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C10;
				dealC10();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C10;
				dealC10();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard9() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C9;
				dealC9();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C9;
				dealC9();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C9;
				dealC9();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C9;
				dealC9();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C9;
				dealC9();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C9;
				dealC9();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C9;
				dealC9();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C9;
				dealC9();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C9;
				dealC9();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C9;
				dealC9();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C9;
				dealC9();
				cardPos4++;
			} else if (cardPos4 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C9;
				dealC9();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C9;
				dealC9();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C9;
				dealC9();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C9;
				dealC9();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C9;
				dealC9();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C9;
				dealC9();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C9;
				dealC9();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C9;
				dealC9();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C9;
				dealC9();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C9;
				dealC9();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C9;
				dealC9();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C9;
				dealC9();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C9;
				dealC9();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C9, Board.C9 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C9;
				dealC9();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C9;
				dealC9();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C9;
				dealC9();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard8() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C8;
				dealC8();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C8;
				dealC8();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C8;
				dealC8();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C8;
				dealC8();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C8;
				dealC8();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C8;
				dealC8();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C8;
				dealC8();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C8;
				dealC8();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C8;
				dealC8();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C8;
				dealC8();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C8;
				dealC8();
				cardPos4++;
			} else if (cardPos4 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C8;
				dealC8();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C8;
				dealC8();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C8;
				dealC8();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C8;
				dealC8();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C8;
				dealC8();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C8;
				dealC8();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C8;
				dealC8();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C8;
				dealC8();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C8;
				dealC8();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C8;
				dealC8();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C8;
				dealC8();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C8;
				dealC8();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C8;
				dealC8();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C8, Board.C8 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C8;
				dealC8();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C8;
				dealC8();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C8;
				dealC8();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard7() {
		if (Interface.input == 1) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos1 == 0) {
				temp.drawFront(S1x, Sdy);
				Board.S1d = Board.C7;
				dealC7();
				cardPos1++;
			} else if (cardPos1 == 1) {
				temp.drawFront(S1x, Sey);
				Board.S1e = Board.C7;
				dealC7();
				cardPos1++;
			} else if (cardPos1 == 2) {
				temp.drawFront(S1x, Sfy);
				Board.S1f = Board.C7;
				dealC7();
				cardPos1++;
				Board.S1cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface.input == 2) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos2 == 0) {
				temp.drawFront(S2x, Sdy);
				Board.S2d = Board.C7;
				dealC7();
				cardPos2++;
			} else if (cardPos2 == 1) {
				temp.drawFront(S2x, Sey);
				Board.S2e = Board.C7;
				dealC7();
				cardPos2++;
			} else if (cardPos2 == 2) {
				temp.drawFront(S2x, Sfy);
				Board.S2f = Board.C7;
				dealC7();
				cardPos2++;
				Board.S2cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 3) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos3 == 0) {
				temp.drawFront(S3x, Sdy);
				Board.S3d = Board.C7;
				dealC7();
				cardPos3++;
			} else if (cardPos3 == 1) {
				temp.drawFront(S3x, Sey);
				Board.S3e = Board.C7;
				dealC7();
				cardPos3++;
			} else if (cardPos3 == 2) {
				temp.drawFront(S3x, Sfy);
				Board.S3f = Board.C7;
				dealC7();
				cardPos3++;
				Board.S3cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 4) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos4 == 0) {
				temp.drawFront(S4x, Sdy);
				Board.S4d = Board.C7;
				dealC7();
				cardPos4++;
			} else if (cardPos4 == 1) {
				temp.drawFront(S4x, Sey);
				Board.S4e = Board.C7;
				dealC7();
				cardPos4++;
			} else if (cardPos4 == 2) {
				temp.drawFront(S4x, Sfy);
				Board.S4f = Board.C7;
				dealC7();
				cardPos4++;
				Board.S4cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 5) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos5 == 0) {
				temp.drawFront(S5x, Sdy);
				Board.S5d = Board.C7;
				dealC7();
				cardPos5++;
			} else if (cardPos5 == 1) {
				temp.drawFront(S5x, Sey);
				Board.S5e = Board.C7;
				dealC7();
				cardPos5++;
			} else if (cardPos5 == 2) {
				temp.drawFront(S5x, Sfy);
				Board.S5f = Board.C7;
				dealC7();
				cardPos5++;
				Board.S5cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 6) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos6 == 0) {
				temp.drawFront(S6x, Sdy);
				Board.S6d = Board.C7;
				dealC7();
				cardPos6++;
			} else if (cardPos6 == 1) {
				temp.drawFront(S6x, Sey);
				Board.S6e = Board.C7;
				dealC7();
				cardPos6++;
			} else if (cardPos6 == 2) {
				temp.drawFront(S6x, Sfy);
				Board.S6f = Board.C7;
				dealC7();
				cardPos6++;
				Board.S6cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 7) {
			Card temp = new Card(Board.C12, Board.C12 + ".gif", "back.gif");
			if (cardPos7 == 0) {
				temp.drawFront(S7x, Sdy);
				Board.S7d = Board.C12;
				dealC12();
				cardPos7++;
			} else if (cardPos7 == 1) {
				temp.drawFront(S7x, Sey);
				Board.S7e = Board.C12;
				dealC12();
				cardPos7++;
			} else if (cardPos7 == 2) {
				temp.drawFront(S7x, Sfy);
				Board.S7f = Board.C12;
				dealC12();
				cardPos7++;
				Board.S7cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 8) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos8 == 0) {
				temp.drawFront(S8x, Sdy);
				Board.S8d = Board.C7;
				dealC7();
				cardPos8++;
			} else if (cardPos8 == 1) {
				temp.drawFront(S8x, Sey);
				Board.S8e = Board.C7;
				dealC7();
				cardPos8++;
			} else if (cardPos8 == 2) {
				temp.drawFront(S8x, Sfy);
				Board.S8f = Board.C7;
				dealC7();
				cardPos8++;
				Board.S8cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface.input == 9) {
			Card temp = new Card(Board.C7, Board.C7 + ".gif", "back.gif");
			if (cardPos9 == 0) {
				temp.drawFront(S9x, Sdy);
				Board.S9d = Board.C7;
				dealC7();
				cardPos9++;
			} else if (cardPos9 == 1) {
				temp.drawFront(S9x, Sey);
				Board.S9e = Board.C7;
				dealC7();
				cardPos9++;
			} else if (cardPos9 == 2) {
				temp.drawFront(S9x, Sfy);
				Board.S9f = Board.C7;
				dealC7();
				cardPos9++;
				Board.S9cap = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard6() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C6;
				dealC6();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C6;
				dealC6();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C6;
				dealC6();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C6;
				dealC6();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C6;
				dealC6();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C6;
				dealC6();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C6;
				dealC6();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C6;
				dealC6();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C6;
				dealC6();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C6;
				dealC6();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C6;
				dealC6();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C6;
				dealC6();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C6;
				dealC6();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C6;
				dealC6();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C6;
				dealC6();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C6;
				dealC6();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C6;
				dealC6();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C6;
				dealC6();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C6;
				dealC6();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C6;
				dealC6();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C6;
				dealC6();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C6;
				dealC6();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C6;
				dealC6();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C6;
				dealC6();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C6, Board.C6 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C6;
				dealC6();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C6;
				dealC6();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C6;
				dealC6();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard5() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C5;
				dealC5();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C5;
				dealC5();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C5;
				dealC5();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C5;
				dealC5();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C5;
				dealC5();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C5;
				dealC5();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C5;
				dealC5();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C5;
				dealC5();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C5;
				dealC5();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C5;
				dealC5();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C5;
				dealC5();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C5;
				dealC5();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C5;
				dealC5();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C5;
				dealC5();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C5;
				dealC5();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C5;
				dealC5();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C5;
				dealC5();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C5;
				dealC5();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C5;
				dealC5();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C5;
				dealC5();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C5;
				dealC5();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C5;
				dealC5();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C5;
				dealC5();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C5;
				dealC5();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C5, Board.C5 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C5;
				dealC5();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C5;
				dealC5();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C5;
				dealC5();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard4() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C4;
				dealC4();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C4;
				dealC4();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C4;
				dealC4();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C4;
				dealC4();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C4;
				dealC4();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C4;
				dealC4();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C4;
				dealC4();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C4;
				dealC4();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C4;
				dealC4();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C4;
				dealC4();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C4;
				dealC4();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C4;
				dealC4();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C4;
				dealC4();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C4;
				dealC4();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C4;
				dealC4();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C4;
				dealC4();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C4;
				dealC4();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C4;
				dealC4();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C4;
				dealC4();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C4;
				dealC4();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C4;
				dealC4();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C4;
				dealC4();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C4;
				dealC4();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C4;
				dealC4();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C4, Board.C4 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C4;
				dealC4();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C4;
				dealC4();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C4;
				dealC4();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard3() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C3;
				dealC3();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C3;
				dealC3();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C3;
				dealC3();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C3;
				dealC3();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C3;
				dealC3();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C3;
				dealC3();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C3;
				dealC3();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C3;
				dealC3();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C3;
				dealC3();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C3;
				dealC3();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C3;
				dealC3();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C3;
				dealC3();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C3;
				dealC3();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C3;
				dealC3();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C3;
				dealC3();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C3;
				dealC3();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C3;
				dealC3();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C3;
				dealC3();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C3;
				dealC3();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C3;
				dealC3();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C3;
				dealC3();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C3;
				dealC3();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C3;
				dealC3();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C3;
				dealC3();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C3, Board.C3 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C3;
				dealC3();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C3;
				dealC3();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C3;
				dealC3();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard2() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C2;
				dealC2();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C2;
				dealC2();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C2;
				dealC2();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C2;
				dealC2();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C2;
				dealC2();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C2;
				dealC2();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C2;
				dealC2();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C2;
				dealC2();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C2;
				dealC2();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C2;
				dealC2();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C2;
				dealC2();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C2;
				dealC2();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C2;
				dealC2();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C2;
				dealC2();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C2;
				dealC2();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C2;
				dealC2();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C2;
				dealC2();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C2;
				dealC2();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C2;
				dealC2();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C2;
				dealC2();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C2;
				dealC2();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C2;
				dealC2();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C2;
				dealC2();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C2;
				dealC2();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C2, Board.C2 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C2;
				dealC2();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C2;
				dealC2();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C2;
				dealC2();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	public static void playCard1() {
		if (Interface2.input == 1) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos1b == 0) {
				temp.drawFront(S1x, Scy);
				Board.S1c = Board.C1;
				dealC1();
				cardPos1b++;
			} else if (cardPos1b == 1) {
				temp.drawFront(S1x, Sby);
				Board.S1b = Board.C1;
				dealC1();
				cardPos1b++;
			} else if (cardPos1b == 2) {
				temp.drawFront(S1x, Say);
				Board.S1a = Board.C1;
				dealC1();
				cardPos1b++;
				Board.S1capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}
		} else if (Interface2.input == 2) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos2b == 0) {
				temp.drawFront(S2x, Scy);
				Board.S2c = Board.C1;
				dealC1();
				cardPos2b++;
			} else if (cardPos2b == 1) {
				temp.drawFront(S2x, Sby);
				Board.S2b = Board.C1;
				dealC1();
				cardPos2b++;
			} else if (cardPos2b == 2) {
				temp.drawFront(S2x, Say);
				Board.S2a = Board.C1;
				dealC1();
				cardPos2b++;
				Board.S2capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 3) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos3b == 0) {
				temp.drawFront(S3x, Scy);
				Board.S3c = Board.C1;
				dealC1();
				cardPos3b++;
			} else if (cardPos3b == 1) {
				temp.drawFront(S3x, Sby);
				Board.S3b = Board.C1;
				dealC1();
				cardPos3b++;
			} else if (cardPos3b == 2) {
				temp.drawFront(S3x, Say);
				Board.S3a = Board.C1;
				dealC1();
				cardPos3b++;
				Board.S3capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 4) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos4b == 0) {
				temp.drawFront(S4x, Scy);
				Board.S4c = Board.C1;
				dealC1();
				cardPos4b++;
			} else if (cardPos4b == 1) {
				temp.drawFront(S4x, Sby);
				Board.S4b = Board.C1;
				dealC1();
				cardPos4b++;
			} else if (cardPos4b == 2) {
				temp.drawFront(S4x, Say);
				Board.S4a = Board.C1;
				dealC1();
				cardPos4b++;
				Board.S4capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 5) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos5b == 0) {
				temp.drawFront(S5x, Scy);
				Board.S5c = Board.C1;
				dealC1();
				cardPos5b++;
			} else if (cardPos5b == 1) {
				temp.drawFront(S5x, Sby);
				Board.S5b = Board.C1;
				dealC1();
				cardPos5b++;
			} else if (cardPos5b == 2) {
				temp.drawFront(S5x, Say);
				Board.S5a = Board.C1;
				dealC1();
				cardPos5b++;
				Board.S5capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 6) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos6b == 0) {
				temp.drawFront(S6x, Scy);
				Board.S6c = Board.C1;
				dealC1();
				cardPos6b++;
			} else if (cardPos6b == 1) {
				temp.drawFront(S6x, Sby);
				Board.S6b = Board.C1;
				dealC1();
				cardPos6b++;
			} else if (cardPos6b == 2) {
				temp.drawFront(S6x, Say);
				Board.S6a = Board.C1;
				dealC1();
				cardPos6b++;
				Board.S6capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 7) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos7b == 0) {
				temp.drawFront(S7x, Scy);
				Board.S7c = Board.C1;
				dealC1();
				cardPos7b++;
			} else if (cardPos7b == 1) {
				temp.drawFront(S7x, Sby);
				Board.S7b = Board.C1;
				dealC1();
				cardPos7b++;
			} else if (cardPos7b == 2) {
				temp.drawFront(S7x, Say);
				Board.S7a = Board.C1;
				dealC1();
				cardPos7b++;
				Board.S7capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 8) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos8b == 0) {
				temp.drawFront(S8x, Scy);
				Board.S8c = Board.C1;
				dealC1();
				cardPos8b++;
			} else if (cardPos8b == 1) {
				temp.drawFront(S8x, Sby);
				Board.S8b = Board.C1;
				dealC1();
				cardPos8b++;
			} else if (cardPos8b == 2) {
				temp.drawFront(S8x, Say);
				Board.S8a = Board.C1;
				dealC1();
				cardPos8b++;
				Board.S8capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		} else if (Interface2.input == 9) {
			Card temp = new Card(Board.C1, Board.C1 + ".gif", "back.gif");
			if (cardPos9b == 0) {
				temp.drawFront(S9x, Scy);
				Board.S9c = Board.C1;
				dealC1();
				cardPos9b++;
			} else if (cardPos9b == 1) {
				temp.drawFront(S9x, Sby);
				Board.S9b = Board.C1;
				dealC1();
				cardPos9b++;
			} else if (cardPos9b == 2) {
				temp.drawFront(S9x, Say);
				Board.S9a = Board.C1;
				dealC1();
				cardPos9b++;
				Board.S9capD = false;
			} else {
				System.out.println("The stone already has 3 cards");
			}

		}
		showDeck();
	}

	// test client
	public static void main(String[] args) {
		StdDraw.setCanvasSize(940, 713);
		StdDraw.setXscale(0, 800);
		StdDraw.setYscale(0, 600);
		StdDraw.clear(StdDraw.BLACK);
		Interface.main(args);
		Interface2.main(args);

		// create deck and shuffle
		Deck.main(args);

		// initial setup
		placeStones();
		dealDealer();
		dealPlayer();
		showDeck();
	}

}